package com.DHH.Service.Capital.Impl;
import com.DHH.Entity.Capital.CapitalSurplusMoneyRecord;
import com.DHH.Mapper.Capital.CapitalSurplusMoneyRecordMapper;
import com.DHH.Service.Capital.ICapitalSurplusMoneyRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CapitalSurplusMoneyRecordServiceImpl implements ICapitalSurplusMoneyRecordService{
	
	@Autowired
    private CapitalSurplusMoneyRecordMapper capitalSurplusMoneyRecordMapper;
    
   @Override
   public CapitalSurplusMoneyRecord insertCapitalSurplusMoneyRecord(CapitalSurplusMoneyRecord capitalSurplusMoneyRecord){
	   
        capitalSurplusMoneyRecordMapper.insertSelective(capitalSurplusMoneyRecord);
	   return capitalSurplusMoneyRecord;
	   
   };
   @Override
   public CapitalSurplusMoneyRecord updateCapitalSurplusMoneyRecord(CapitalSurplusMoneyRecord capitalSurplusMoneyRecord){
	     capitalSurplusMoneyRecordMapper.updateByPrimaryKeySelective(capitalSurplusMoneyRecord);
        return capitalSurplusMoneyRecord;
   };
   @Override
   public CapitalSurplusMoneyRecord deleteCapitalSurplusMoneyRecord(CapitalSurplusMoneyRecord capitalSurplusMoneyRecord){

	     capitalSurplusMoneyRecordMapper.delete(capitalSurplusMoneyRecord);
        return capitalSurplusMoneyRecord;
   };
    /**
     * 保存或更新操作，返回值为主表
     */
    public CapitalSurplusMoneyRecord saveOrUpdateCapitalSurplusMoneyRecord(CapitalSurplusMoneyRecord capitalSurplusMoneyRecord){
        if(capitalSurplusMoneyRecord.getId()==null)
        {
            capitalSurplusMoneyRecordMapper.insertSelective(capitalSurplusMoneyRecord);
        }else{
            capitalSurplusMoneyRecordMapper.updateByPrimaryKeySelective(capitalSurplusMoneyRecord);
        }
        return capitalSurplusMoneyRecord;
    };
}
